<template>
    <div class="mt10">
      <AplidForm v-model="searchModel" v-bind="serviseStatusConfig" ref="searchRef" :showRules="false" @reset="onReset"
        @submit="onSearch" />
  
      <el-table show-summary :data="tableData" style="width: 100%">
        
            <el-table-column label="组织名称" prop="organizationName">
            </el-table-column>
            <el-table-column label="政府购买服务统计" align="center" >
                <el-table-column label="服务人数" align="center" prop="governmentServicePersonnelNum">
                
                </el-table-column>
                <el-table-column label="服务人次" align="center" prop="governmentServicePersonSecond">
                    
                </el-table-column>
            </el-table-column>
            <el-table-column label="60-79周岁老年人服务统计" align="center" prop="registeredPopulationSecond" >
                <el-table-column label="服务人数" align="center" prop="servicesForTheElderlyNum">
                
                </el-table-column>
                <el-table-column label="服务人次" align="center" prop="servicesForTheElderlySecond">
                    
                </el-table-column>
            </el-table-column>
            <el-table-column label="居家绩效考核对象服务统计" align="center"> 
                <el-table-column label="服务人数" align="center" prop="homeServicePersonnelNum">
                
                </el-table-column>
                <el-table-column label="服务人次" align="center" prop="homeServicePersonSecond">
                    
                </el-table-column>
                </el-table-column>
      </el-table>
    </div>
  </template>
  
  <script setup lang="ts">
  import { serviseStatusConfig } from '../config'
  import apiMod from '@/apiMod'
  const userInfo = JSON.parse(sessionStorage.getItem('apld-xningxiang-userInfo')).content
  let currentName = ref('')
  currentName.value = userInfo.organizationName
  const activeArea = ref('')
  const nowAreaList = ref([
    {
      label: '当前市名称',
      value: '',
      level: 0
    },
  ])
  const searchModel = ref()
  const tableData = ref([])
  const nowRowData = ref({})
  const currentArea = ref()

  // 市看区1,区看街道2，街道看社区传3，本社区传0
  let classifyList = ref([])
  let classifyLength = ref(0)
  let lastLevel = ref(0)
 
  const getInitData = () => {
    apiMod.view_statistics_organizationService({
        organizationName: searchModel.value?.organizationName|| '',
        timeBetween: searchModel.value?.timeBetween|| ''
    }).then(res=>{
      tableData.value = res.data.resp
      console.log(tableData.value)
    })
  }
  const onSearch = (form, done) => {
    console.log('查看',form)
    searchModel.value = form
    getInitData()
    done()
  }
  
  const onReset = () => {
    searchModel.value = {}
   
      getInitData()
  }
  
  onMounted(() => {
    getInitData()
  })
  </script>
  
  <style scoped lang="scss">
  .nav-box {
    width: 100%;
    display: flex;
    gap: 20px;
    padding-bottom: 10px;
  
    .nav-item {
      position: relative;
  
      &:not(:last-child):after {
        content: '>';
        width: 20px;
        height: 20px;
        position: absolute;
        top: 0;
        right: -25px;
        font-weight: bold;
      }
  
      &:hover {
        cursor: pointer;
      }
    }
  
    .active {
      color: rgb(6, 69, 243);
      font-weight: bold;
    }
  }
  </style>
  